import { IFeidaoAiBrowserComponent } from '@feidao/web/interfaces';
import Text from '@feidao/widgets/fd-w000013';

export default async function a001(fd: IFeidaoAiBrowserComponent, ...args: any[]) {
	const v = fd.data.node.querySelector<HTMLInputElement>('[data-feidao-id="set_value"]').value;
	if (!v) {
		alert('请输入设置内容');
	} else {
		const t = fd.data.node.querySelector<Text>('[data-feidao-id="fd-w000013-001"]');
		t.set_value(v);
	}
	fd.data.node.querySelector<HTMLTextAreaElement>('[data-feidao-id="fd-w000013-005"]').innerHTML = `const v = fd.data.node.querySelector<HTMLInputElement>('[data-feidao-id="set_value"]').value;
if (!v) {
	alert('请输入设置内容');
} else {
	const t = fd.data.node.querySelector<Text>('[data-feidao-id="fd-w000013-001"]');
	t.set_value(v);
}`;
}
